package com.ui.activity;

import roboguice.inject.InjectView;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.core.sdk.core.BaseActivity;
import com.core.sdk.ui.date.CellItem;
import com.core.sdk.ui.date.DatePicker;
import com.core.sdk.ui.date.DatePickerDialog;
import com.core.sdk.ui.date.OnCellItemClickListener;
import com.core.sdk.utils.ToastUtil;
import com.ui.R;

public class DatePickerActivity extends BaseActivity implements OnCellItemClickListener, OnClickListener {

	@InjectView(R.id.act_date_picker)
	DatePicker datePicker;

	DatePickerDialog datePickerDialog;

	@InjectView(R.id.act_date_picker_show_dialog)
	Button btnShowDialog;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		datePicker.setOnCellItemClickListener(this);
		datePicker.setVisibility(View.VISIBLE);
		datePickerDialog = new DatePickerDialog(this, this);
		btnShowDialog.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		datePickerDialog.show("select a date");
	}

	@Override
	protected int getContentView() {
		return R.layout.act_date_picker;
	}

	@Override
	public void onItemClick(CellItem cellItem) {
		String msg = cellItem.getDay() + "";
		ToastUtil.show(this, msg);

	}

}
